package com.han.hotelplat.cms.controller.question;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.han.hotelplat.comm.ResponseWrapTo;
import com.han.hotelplat.comm.ResponseWrapTo.CodeType;
import com.han.hotelplat.comm.base.Pager;
import com.han.hotelplat.pojo.question.Question;
import com.han.hotelplat.service.question.QuestionService;

@Controller
@RequestMapping("/cms/question")
public class CMSQuestionController {
	@Autowired
	private QuestionService questionService;
	
	@ResponseBody
	@RequestMapping(value = "getAllQuestion", produces = "application/json;charset=UTF-8", method = { RequestMethod.GET,RequestMethod.POST  })
	public String getAllQuestion(Integer pageNo, String startTime, String endTime, String tel,Integer state){
		Pager<Question>data = questionService.getAllQuestionByPage(pageNo,startTime,endTime,tel,state);
		return new ResponseWrapTo(CodeType.success, "数据获取成功", data).toJson();
	}
}
